﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using Codeblack.TfsScrumboard.Interfaces;
using Codeblack.TfsScrumboard.Services;
using Codeblack.TfsScrumboard.ViewModels;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Client;
using Microsoft.TeamFoundation.WebAccess.Common;
using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace Codeblack.TfsScrumboard.TestSuite
{
    class Program
    {
        private static Uri ConfigurationServerUri = new Uri("http://localhost:8080/tfs");
        private static Uri TeamCollectionUri = new Uri("http://localhost:8080/tfs/DefaultCollection");
        private const string ProjectName = "Test1";

        static void Main(string[] args)
        {
            //TfsTeamProjectCollection teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(TeamCollectionUri);
            //WorkItemStore workitemStore = teamProjectCollection.GetService<WorkItemStore>();

            //Project project = workitemStore.Projects[ProjectName];


            //IScrumboardService scrumboardService = new ScrumboardService();

            //PlanningViewModel planningViewModel = scrumboardService.GetPlanning(project, "Sprint 1");



            //Uri tpcUri = new Uri("http://localhost:8080/tfs/web/UI/Pages/Scrumboard/Planning.aspx?pguid=d32e548d-4883-42e3-a33f-7981b570236b");
            //TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(tpcUri);
            //WorkItemStore wis = teamProjectCollection.GetService<WorkItemStore>();

            //Project p = wis.Projects[ProjectName];

            //Guid loc = TfsLocator.CreateProjectGuidFrom(p.Uri);



            //NameValueCollection parameters = new NameValueCollection();
            //parameters.Add("pguid", "d32e548d-4883-42e3-a33f-7981b570236b");
            //TfsLocator location = TfsLocator.CreateFromPairs(parameters);
            //TfsLocator tfsLocation = TfsLocator.CreateProjectLocator(tpcUri, location.ProjectGuid);

            ////TfsLocator tfsLocation = TfsLocator.CreateProjectLocator(new Uri("http://localhost:8080/tfs/web/UI/Pages/Scrumboard/Planning.aspx?pguid=d32e548d-4883-42e3-a33f-7981b570236b"), location.ProjectGuid);

            ////scrumboardService.GetPlanning(tfsLocation, "Sprint 1");
        }
    }
}
